#
# Win32 barebone makefile for c++ examples.
#
# Simply run make or make clean
# Intend this makefile only as a "batch examples updater" after library modification.
#
# Change vars MINGW and MINREL in accord to your compiler path/release
# Here we link statically libstdc++, this is needed if the dll was not generated by MinGW
#
#                
MINGW    =C:/MinGW64
MINREL   =4.7.1
#
#
CPP      = g++.exe
CC       = gcc.exe
LIBS     = -L"$(MINGW)/lib" -static-libgcc ../../../build/bin/legacy/win64/snap7.lib 
INCS     = -I"$(MINGW)/include" -I"../"
CXXINCS  = -I"$(MINGW)/include" -I"../"
CXXFLAGS = -O3 $(CXXINCS) 
CFLAGS   = -O3 $(INCS) 
RM       = rm -f

.PHONY: all clean 

all:
	$(CC) -o client.exe ../client.c $(LIBS) $(CFLAGS)
	$(CC) -o server.exe ../server.c $(LIBS) $(CFLAGS)
	$(CC) -o srv_resourceless.exe ../srv_resourceless.c $(LIBS) $(CFLAGS)
	$(CC) -o apartner.exe ../apartner.c $(LIBS) $(CFLAGS)
	$(CC) -o ppartner.exe ../ppartner.c $(LIBS) $(CFLAGS)

clean: 
	${RM} client.exe 
	${RM} server.exe 
	${RM} srv_resourceless.exe 
	${RM} apartner.exe 
	${RM} ppartner.exe 



